unit UnitRelDiaDia;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RLReport, DB, ADODB, RLParser, RLFilters, RLXLSFilter,
  RLPDFFilter;

type
  TRelDiarioPosto = class(TForm)
    rlRelatorio: TRLReport;
    qryConsulta: TADOQuery;
    dsConsulta: TDataSource;
    qryConsultaFRANQUIA: TIntegerField;
    qryConsultaGUIAS: TIntegerField;
    qryConsultaCLARO15: TIntegerField;
    qryConsultaCLARO20: TIntegerField;
    qryConsultaCLARO30: TIntegerField;
    qryConsultaCLARO50: TIntegerField;
    qryConsultaOI05: TIntegerField;
    qryConsultaOI10: TIntegerField;
    qryConsultaOI15: TIntegerField;
    qryConsultaOI20: TIntegerField;
    qryConsultaOI25: TIntegerField;
    qryConsultaOI50: TIntegerField;
    qryConsultaTIM20: TIntegerField;
    qryConsultaTIM25: TIntegerField;
    qryConsultaTIM35: TIntegerField;
    grpGrupo: TRLGroup;
    RLBand4: TRLBand;
    RLBand2: TRLBand;
    RLDraw21: TRLDraw;
    RLDraw22: TRLDraw;
    RLDraw23: TRLDraw;
    RLDraw24: TRLDraw;
    RLDraw25: TRLDraw;
    RLDraw26: TRLDraw;
    RLDraw27: TRLDraw;
    RLDraw30: TRLDraw;
    RLDraw33: TRLDraw;
    RLDraw34: TRLDraw;
    RLDraw35: TRLDraw;
    RLDraw36: TRLDraw;
    RLDraw37: TRLDraw;
    RLDraw38: TRLDraw;
    RLDraw39: TRLDraw;
    dbLinha: TRLDBText;
    RLDBText3: TRLDBText;
    RLDBText4: TRLDBText;
    RLDBText5: TRLDBText;
    RLDBText6: TRLDBText;
    RLDBText7: TRLDBText;
    RLDBText8: TRLDBText;
    RLDBText9: TRLDBText;
    RLDBText10: TRLDBText;
    RLDBText11: TRLDBText;
    RLDBText12: TRLDBText;
    RLDBText13: TRLDBText;
    RLDBText14: TRLDBText;
    RLDBText15: TRLDBText;
    RLDBText17: TRLDBText;
    RLDBText18: TRLDBText;
    RLDBText19: TRLDBText;
    RLDBText20: TRLDBText;
    RLDraw45: TRLDraw;
    qryConsultaNOME_FANTASIA: TStringField;
    RLXLSFilter1: TRLXLSFilter;
    RLDraw40: TRLDraw;
    RLDraw80: TRLDraw;
    RLExpressionParser1: TRLExpressionParser;
    RLPDFFilter1: TRLPDFFilter;
    RLBand1: TRLBand;
    RLDraw81: TRLDraw;
    RLImage1: TRLImage;
    RLSystemInfo1: TRLSystemInfo;
    RLSystemInfo2: TRLSystemInfo;
    dbCabecalho: TRLDBText;
    rlLinha: TRLLabel;
    RLLabel2: TRLLabel;
    RLLabel3: TRLLabel;
    RLLabel4: TRLLabel;
    RLLabel5: TRLLabel;
    RLDraw2: TRLDraw;
    RLDraw6: TRLDraw;
    RLDraw18: TRLDraw;
    RLLabel19: TRLLabel;
    RLDraw82: TRLDraw;
    rlIntervalo: TRLLabel;
    RLDraw3: TRLDraw;
    RLDraw4: TRLDraw;
    RLDraw7: TRLDraw;
    bandRoData: TRLBand;
    qryConsultaDATA_VENDA: TDateTimeField;
    qryConsultaTIM: TIntegerField;
    qryConsultaCLARO: TIntegerField;
    qryConsultaOI: TIntegerField;
    RLDBText1: TRLDBText;
    RLDraw115: TRLDraw;
    RLDraw57: TRLDraw;
    RLDraw89: TRLDraw;
    RLDraw69: TRLDraw;
    qryConsultaTIM15: TIntegerField;
    RLDraw118: TRLDraw;
    RLDBResult53: TRLDBResult;
    RLDBResult54: TRLDBResult;
    RLDBResult55: TRLDBResult;
    RLDBResult56: TRLDBResult;
    RLDBResult57: TRLDBResult;
    RLDBResult58: TRLDBResult;
    RLDBResult59: TRLDBResult;
    RLDBResult60: TRLDBResult;
    RLDBResult61: TRLDBResult;
    RLDBResult62: TRLDBResult;
    RLDBResult63: TRLDBResult;
    RLDBResult64: TRLDBResult;
    RLDBResult65: TRLDBResult;
    RLDBResult66: TRLDBResult;
    RLDBResult67: TRLDBResult;
    RLDBResult68: TRLDBResult;
    RLLabel39: TRLLabel;
    RLDraw119: TRLDraw;
    RLDraw120: TRLDraw;
    RLDraw123: TRLDraw;
    RLDraw124: TRLDraw;
    RLDraw125: TRLDraw;
    RLDraw126: TRLDraw;
    RLDraw127: TRLDraw;
    RLDraw128: TRLDraw;
    RLDraw135: TRLDraw;
    RLDraw136: TRLDraw;
    RLDraw137: TRLDraw;
    RLDraw138: TRLDraw;
    RLDraw139: TRLDraw;
    RLDraw140: TRLDraw;
    RLDBResult72: TRLDBResult;
    RLDraw142: TRLDraw;
    RLDraw143: TRLDraw;
    RLDraw144: TRLDraw;
    RLDraw146: TRLDraw;
    RLDraw147: TRLDraw;
    RLDBResult78: TRLDBResult;
    RLDraw49: TRLDraw;
    RLDraw50: TRLDraw;
    RLDBText22: TRLDBText;
    RLDraw52: TRLDraw;
    RLDBText23: TRLDBText;
    RLDraw55: TRLDraw;
    RLDBText24: TRLDBText;
    RLDraw56: TRLDraw;
    RLDBText25: TRLDBText;
    RLDraw58: TRLDraw;
    RLDBText26: TRLDBText;
    RLDBText27: TRLDBText;
    RLDraw62: TRLDraw;
    RLDBText30: TRLDBText;
    RLDraw63: TRLDraw;
    RLDBText31: TRLDBText;
    RLDBText32: TRLDBText;
    RLDBText36: TRLDBText;
    RLDraw71: TRLDraw;
    RLDraw73: TRLDraw;
    RLDraw77: TRLDraw;
    RLDraw79: TRLDraw;
    RLDraw83: TRLDraw;
    RLDraw116: TRLDraw;
    RLDraw129: TRLDraw;
    RLDraw130: TRLDraw;
    RLDraw131: TRLDraw;
    RLDraw134: TRLDraw;
    RLDraw145: TRLDraw;
    RLDraw148: TRLDraw;
    RLDraw149: TRLDraw;
    RLDraw150: TRLDraw;
    RLDBResult4: TRLDBResult;
    RLDBResult5: TRLDBResult;
    RLDBResult6: TRLDBResult;
    RLDBResult7: TRLDBResult;
    RLDBResult9: TRLDBResult;
    RLDBResult17: TRLDBResult;
    RLDBResult20: TRLDBResult;
    RLDBResult24: TRLDBResult;
    RLDBResult25: TRLDBResult;
    RLDBResult26: TRLDBResult;
    qryConsultaEMBLDR10: TIntegerField;
    qryConsultaEMBLDR15: TIntegerField;
    qryConsultaEMBLDR30: TIntegerField;
    qryConsultaEMBLDR45: TIntegerField;
    qryConsultaEMBLDR90: TIntegerField;
    qryConsultaEMBLIVRE07: TIntegerField;
    qryConsultaEMBLIVRE15: TIntegerField;
    qryConsultaEMBLIVRE21: TIntegerField;
    qryConsultaEMBLIVRE50: TIntegerField;
    qryConsultaEMBLIVRE70: TIntegerField;
    qryConsultaEMBLIVRE90: TIntegerField;
    qryConsultaEMBLIVRE: TBCDField;
    qryConsultaEMBLDR: TBCDField;
    qryConsultaEMBLDR20: TIntegerField;
    RLLabel9: TRLLabel;
    RLDBText2: TRLDBText;
    qryConsultaCLARO10: TIntegerField;
    qryConsultaEMBLIVRE55: TIntegerField;
    qryConsultaEMBLIVRE75: TIntegerField;
    RLDBResult1: TRLDBResult;
    RLDBText16: TRLDBText;
    RLDBResult2: TRLDBResult;
    RLDBText21: TRLDBText;
    RLDBResult3: TRLDBResult;
    qryConsultaTIM50: TIntegerField;
    RLLabel6: TRLLabel;
    RLLabel7: TRLLabel;
    RLLabel8: TRLLabel;
    RLLabel11: TRLLabel;
    RLLabel12: TRLLabel;
    RLLabel13: TRLLabel;
    RLLabel16: TRLLabel;
    RLLabel17: TRLLabel;
    RLDraw5: TRLDraw;
    RLDraw9: TRLDraw;
    RLDraw10: TRLDraw;
    RLDraw11: TRLDraw;
    RLDraw12: TRLDraw;
    RLDraw19: TRLDraw;
    RLDraw20: TRLDraw;
    RLLabel21: TRLLabel;
    RLLabel22: TRLLabel;
    RLLabel26: TRLLabel;
    RLDraw70: TRLDraw;
    RLDraw14: TRLDraw;
    RLLabel36: TRLLabel;
    RLDraw76: TRLDraw;
    RLLabel35: TRLLabel;
    RLLabel18: TRLLabel;
    RLLabel27: TRLLabel;
    RLLabel37: TRLLabel;
    RLLabel29: TRLLabel;
    RLLabel30: TRLLabel;
    RLDraw13: TRLDraw;
    RLLabel32: TRLLabel;
    RLLabel33: TRLLabel;
    RLLabel34: TRLLabel;
    RLLabel38: TRLLabel;
    RLDraw17: TRLDraw;
    RLDraw8: TRLDraw;
    RLDraw114: TRLDraw;
    RLDraw29: TRLDraw;
    RLLabel42: TRLLabel;
    RLDraw43: TRLDraw;
    RLDraw42: TRLDraw;
    RLDraw41: TRLDraw;
    RLDraw44: TRLDraw;
    RLLabel44: TRLLabel;
    RLDraw46: TRLDraw;
    RLDraw47: TRLDraw;
    RLLabel47: TRLLabel;
    RLLabel51: TRLLabel;
    RLLabel52: TRLLabel;
    RLLabel53: TRLLabel;
    RLLabel20: TRLLabel;
    RLDraw72: TRLDraw;
    RLLabel23: TRLLabel;
    RLLabel10: TRLLabel;
    RLLabel14: TRLLabel;
    RLDraw16: TRLDraw;
    RLDraw51: TRLDraw;
    RLDraw53: TRLDraw;
    RLDraw60: TRLDraw;
    RLDraw65: TRLDraw;
    RLDraw67: TRLDraw;
    RLDraw68: TRLDraw;
    RLDraw85: TRLDraw;
    RLDraw78: TRLDraw;
    RLDraw86: TRLDraw;
    RLDraw88: TRLDraw;
    RLLabel15: TRLLabel;
    RLDBResult47: TRLDBResult;
    RLDBResult48: TRLDBResult;
    RLDBResult49: TRLDBResult;
    RLDBResult50: TRLDBResult;
    RLDBResult51: TRLDBResult;
    RLDBResult69: TRLDBResult;
    RLDBResult70: TRLDBResult;
    RLDBResult71: TRLDBResult;
    RLDBResult73: TRLDBResult;
    RLDBResult74: TRLDBResult;
    RLDBResult75: TRLDBResult;
    RLDBResult77: TRLDBResult;
    RLDBResult79: TRLDBResult;
    RLDBResult80: TRLDBResult;
    RLDBResult81: TRLDBResult;
    RLDBResult82: TRLDBResult;
    RLDBResult84: TRLDBResult;
    RLDBResult85: TRLDBResult;
    RLDBResult86: TRLDBResult;
    RLDBResult87: TRLDBResult;
    RLDBResult88: TRLDBResult;
    RLDBResult91: TRLDBResult;
    RLDBResult92: TRLDBResult;
    RLDBResult93: TRLDBResult;
    qryDemanda: TADOQuery;
    dsDemanda: TDataSource;
    qryDemandaFRANQUIA: TIntegerField;
    qryDemandaQTDPOS: TIntegerField;
    qryDemandaCLARO10: TIntegerField;
    qryDemandaCLARO15: TIntegerField;
    qryDemandaCLARO20: TIntegerField;
    qryDemandaCLARO30: TIntegerField;
    qryDemandaCLARO50: TIntegerField;
    qryDemandaOI05: TIntegerField;
    qryDemandaOI15: TIntegerField;
    qryDemandaOI20: TIntegerField;
    qryDemandaOI25: TIntegerField;
    qryDemandaOI50: TIntegerField;
    qryDemandaTIM15: TIntegerField;
    qryDemandaTIM20: TIntegerField;
    qryDemandaTIM25: TIntegerField;
    qryDemandaTIM35: TIntegerField;
    qryDemandaTIM50: TIntegerField;
    qryDemandaLDR10: TIntegerField;
    qryDemandaLDR15: TIntegerField;
    qryDemandaLDR20: TIntegerField;
    qryDemandaLIVRE7: TIntegerField;
    qryDemandaLIVRE15: TIntegerField;
    qryDemandaLIVRE21: TIntegerField;
    qryDemandaLIVRE55: TIntegerField;
    qryDemandaLIVRE75: TIntegerField;
    qryDemandaLIVRE90: TIntegerField;
    qryDemandaOI10: TIntegerField;
    RLLabel24: TRLLabel;
    RLDraw54: TRLDraw;
    RLDraw59: TRLDraw;
    RLDraw84: TRLDraw;
    RLDBText28: TRLDBText;
    RLDBResult19: TRLDBResult;
    RLDBResult8: TRLDBResult;
    RLDraw1: TRLDraw;
    RLDraw15: TRLDraw;
    RLDraw28: TRLDraw;
    RLDraw31: TRLDraw;
    RLDBResult10: TRLDBResult;
    RLDBResult11: TRLDBResult;
    RLDBResult12: TRLDBResult;
    RLDBResult13: TRLDBResult;
    RLDBResult14: TRLDBResult;
    RLDBResult15: TRLDBResult;
    RLDBResult16: TRLDBResult;
    RLDBResult18: TRLDBResult;
    RLDBResult21: TRLDBResult;
    RLDBResult22: TRLDBResult;
    RLDBResult23: TRLDBResult;
    RLDBResult27: TRLDBResult;
    RLDBResult28: TRLDBResult;
    RLDBResult29: TRLDBResult;
    RLDBResult30: TRLDBResult;
    RLDBResult31: TRLDBResult;
    RLLabel1: TRLLabel;
    RLDraw32: TRLDraw;
    RLDraw48: TRLDraw;
    RLDraw61: TRLDraw;
    RLDraw64: TRLDraw;
    RLDraw66: TRLDraw;
    RLDraw74: TRLDraw;
    RLDraw75: TRLDraw;
    RLDraw87: TRLDraw;
    RLDraw90: TRLDraw;
    RLDraw91: TRLDraw;
    RLDraw92: TRLDraw;
    RLDraw93: TRLDraw;
    RLDraw94: TRLDraw;
    RLDraw95: TRLDraw;
    RLDBResult32: TRLDBResult;
    RLDraw96: TRLDraw;
    RLDraw97: TRLDraw;
    RLDraw98: TRLDraw;
    RLDraw99: TRLDraw;
    RLDraw100: TRLDraw;
    RLDBResult33: TRLDBResult;
    RLDraw101: TRLDraw;
    RLDraw102: TRLDraw;
    RLDraw103: TRLDraw;
    RLDraw104: TRLDraw;
    RLDraw105: TRLDraw;
    RLDraw106: TRLDraw;
    RLDraw107: TRLDraw;
    RLDraw108: TRLDraw;
    RLDraw109: TRLDraw;
    RLDraw110: TRLDraw;
    RLDraw111: TRLDraw;
    RLDraw112: TRLDraw;
    RLDBResult34: TRLDBResult;
    RLDBResult35: TRLDBResult;
    RLDBResult36: TRLDBResult;
    RLDBResult37: TRLDBResult;
    RLDBResult38: TRLDBResult;
    RLDBResult39: TRLDBResult;
    RLDBResult40: TRLDBResult;
    RLDBResult41: TRLDBResult;
    RLDBResult42: TRLDBResult;
    RLDBResult43: TRLDBResult;
    RLDBResult44: TRLDBResult;
    RLDBResult45: TRLDBResult;
    RLDraw113: TRLDraw;
    RLDraw117: TRLDraw;
    RLDraw121: TRLDraw;
    RLLabel25: TRLLabel;
    RLDBResult46: TRLDBResult;
    RLDBResult52: TRLDBResult;
    RLDBResult76: TRLDBResult;
    RLDBResult83: TRLDBResult;
    RLDBResult89: TRLDBResult;
    RLDBResult90: TRLDBResult;
    RLDBResult94: TRLDBResult;
    RLDBResult95: TRLDBResult;
    RLDBResult96: TRLDBResult;
    RLDBResult97: TRLDBResult;
    RLDBResult98: TRLDBResult;
    RLDBResult99: TRLDBResult;
    RLDBResult100: TRLDBResult;
    RLDBResult101: TRLDBResult;
    RLDBResult102: TRLDBResult;
    RLDBResult103: TRLDBResult;
    RLDBResult104: TRLDBResult;
    RLDBResult105: TRLDBResult;
    RLDBResult106: TRLDBResult;
    RLDBResult107: TRLDBResult;
    RLDBResult108: TRLDBResult;
    RLDBResult109: TRLDBResult;
    RLDBResult110: TRLDBResult;
    RLDBResult111: TRLDBResult;
    RLDraw122: TRLDraw;
    RLDBResult112: TRLDBResult;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure qryConsultaAfterOpen(DataSet: TDataSet);
    procedure qryConsultaAfterClose(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  RelDiarioPosto: TRelDiarioPosto;

implementation

uses UnitPrincipal;

{$R *.dfm}

procedure TRelDiarioPosto.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action := caFree;
  RelDiarioPosto := nil;
end;

procedure TRelDiarioPosto.qryConsultaAfterOpen(DataSet: TDataSet);
begin
  qryDemanda.Open;
end;

procedure TRelDiarioPosto.qryConsultaAfterClose(DataSet: TDataSet);
begin
  qryDemanda.Close;
end;

end.
